<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <!-- <transition name="hello" :appear="true"> -->
      <transition name="hello" appear>
      <h1 v-show="isShow">你好啊!</h1>
    </transition>

    <transition name="school" appear>
      <h1 v-show="isShow">尚硅谷</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: "Test",
  data() {
    return {
      isShow: true,
    };
  },
};
</script>
<style scoped>
h1 {
  background-color: orange;
}
.hello-enter-active {
  animation: atguigu 0.5s linear;
}
.hello-leave-active {
  animation: atguigu 0.5s reverse;
}
.school-enter-active {
  animation: atguigu 1000ms linear;
}
.school-leave-active {
  animation: atguigu 1000ms reverse;
}

/* 动画效果 */
@keyframes atguigu {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0px);
  }
}
</style>>
</style>
